#include "TreeNode.h"
#include "TreeTest.h"
#include <iostream>



template<class Type>
void print(Type* node){
	std::cout<<node->data<<std::endl;
}

typedef TreeNode<int> IntTreeNode;
void TestTree(){
	IntTreeNode* tree0  = NULL,
	tree1 = {1,NULL,NULL},
	tree11 = {11,NULL,NULL},
	tree20 = {21,&tree1,NULL},
	tree21 = {21,NULL ,&tree1},
	tree22 = {22,&tree11 ,&tree1},
	tree40  = {4,&tree22,NULL},

	tree12 = {12,NULL,NULL},
	tree41  = {4,&tree22,&tree12};

	PreorderTraverse(&tree41,print);
	std::cout<<"-----"<<std::endl;
	PostorderTraverse(&tree41,print);

	std::cout<<"-----"<<std::endl;
	InorderTraverse(&tree41,print);

}